﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFSQLiteOneToManay
{
    public class InspGroupRecordMapping : BaseDomainMapping<InspGroupRecord>
    {
        public override void Init()
        {
            ToTable("GroupRecord");
            HasKey(l => l.ID);
            Property(l => l.ErrorType).HasMaxLength(50).IsRequired();
            Property(l => l.GroupName).HasMaxLength(200).IsRequired();
            Property(l => l.GID).HasMaxLength(200).IsRequired();

            HasMany(t => t.Items).WithRequired(t => t.GR).HasForeignKey(t => t.IID).WillCascadeOnDelete();
        }
    }
}
